Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: Add Win32 Vulkan example. #8180

Closed
wants to merge 1 commit into from

Conversation

jristic
Copy link
Contributor

@jristic jristic commented Nov 23, 2024

I'm not sure if you'd want to maintain a Win32/Vulkan example since I expect the SDL3 one is sufficient for most people, but I put together one for my own sake and I figured I may as well share in case you do. I basically took the Win32/DX12 example, removed the DX12 code and then added the Vulkan code from the SDL3/Vulkan example. Really the only new code I wrote was the extensions for surface creation:

ImVector<const char*> extensions;
extensions.push_back("VK_KHR_surface");
extensions.push_back("VK_KHR_win32_surface");
SetupVulkan(extensions);

@ocornut
Copy link
Owner

ocornut commented Nov 30, 2024

Thank you. It looks good so I'll probably eventually merge, but I admit maintaining 4 Vulkan examples is a little bit of a weight.

I'll be tempted to see if for some of the functions shared among those 4 examples we can sneakily move them under the backends are optional helpers.

ocornut added a commit that referenced this pull request Jan 6, 2025
…hysicalDevice(), ImGui_ImplVulkanH_SelectQueueFamilyIndex(). (#8180)
@ocornut
Copy link
Owner

ocornut commented Jan 6, 2025

I have pushed a2e2172 which removes ~40 lines of cruft from each of the main.cpp file using Vulkan.
If you have a chance you may add the calls to ImGui_ImplVulkanH_SelectPhysicalDevice() and ImGui_ImplVulkanH_SelectQueueFamilyIndex().

@ocornut
Copy link
Owner

ocornut commented Jan 6, 2025

Merged your PR as 38e606a + misc amends 93a9307 (had to manually revert to older VS project + other minor tweaks).

  • Added support for multi-viewport with 3cdf3f9 (this unfortunately needs a function in the main.cpp file which ideally would be in imgui_impl_win32.cpp but I don't know how to do it properly because it would drag a dependency).
    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants